/**
 * 
 */
package com.wgo.precise.client.ui.model;

import com.wgo.precise.common.VO.PropertyValue;

/**
 * @author petterei
 * @version $Id: PropertyValueWrapper.java,v 1.2 2006-01-30 21:52:32 petterei Exp $
 */
public class PropertyValueWrapper extends com.wgo.precise.client.ui.model.PropertyValue {
	
	private PropertyDefWrapper definitionWrapper = null;
	private PropertyValue domainValue = null;
	
	public PropertyValueWrapper(PropertyValue domainValue, PropertyDefWrapper definitionWrapper) {
		this.domainValue = domainValue;
		this.definitionWrapper = definitionWrapper;
	}
	
	@Override
	public Object getValue() {
		String stringValue = domainValue.getValue();
		return getPropertySpesification().getPropertyType().createObjectValue(stringValue);
	}

	@Override
	protected void setValue(Object objectValue) {
		String stringValue = getPropertySpesification().getPropertyType().createStringValue(objectValue);
		domainValue.setValue(stringValue);
	}

//	@Override
//	protected void setPropertySpesification(AbstractPropertySpesification propertySepesification) {
//		// TODO Auto-generated method stub
//		
//	}

	@Override
	public AbstractPropertySpesification getPropertySpesification() {
		return definitionWrapper;
	}
}
